<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>ScarecrowApiDoc</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="./css/font.css">
        <link rel="stylesheet" href="./css/xadmin.css">
        <script src="./lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="./js/xadmin.js"></script>

        <script type="text/javascript" src="./js/jquery.min.js"></script>
        <script type="text/javascript" src="./js/config.js"></script>
        <script type="text/javascript" src="./lib/scarecrow/createSignSdk.js"></script>
        <script type="text/javascript" src="./lib/scarecrow/scarecrowRequest_scarecrow.min.js"></script>
        <script type="text/javascript" src="./js/httpRequest.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
          <script src="./js/html5.min.js"></script>
          <script src="./js/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <blockquote class="layui-elem-quote"><span id="showUserName" style="color: red;"></span> 欢迎使用ScarecrowApiDoc,当前时间: <span id="showNowTime"></span></blockquote>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">数据统计</div>
                        <div class="layui-card-body ">
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>用户数</h3>
                                        <p>
                                            <cite><span id="userNum">0</span></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>项目数</h3>
                                        <p>
                                            <cite><span id="projectNum">0</span></cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md2 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>接口数</h3>
                                        <p>
                                            <cite><span id="apiNum">0</span></cite></p>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>

                <div class="layui-col-md12" style="margin-bottom: 100px;">
                    <div class="layui-card">
                        <div class="layui-card-header">开发团队</div>
                        <div class="layui-card-body ">
                            <table class="layui-table">
                                <tbody>
                                    <tr>
                                        <th>版权所有</th>
                                        <td>Scarecrow
                                            <a href="http://www.scarecrow.top/" target="_blank" id="gwUrl">访问官网</a></td>
                                    </tr>
                                    <tr>
                                        <th>开发者</th>
                                        <td>Scarecrow(1366635163@qq.com)</td></tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <style id="welcome_style"></style>
                <div class="layui-col-md12" style="position: fixed;bottom: 0px;color: #CDCDCD;"><blockquote class="layui-elem-quote layui-quote-nm">感谢layui,本系统由x-admin提供前端框架技术。</blockquote></div>
            </div>
        </div>
        </div>

    <script>
        Date.prototype.Format = function (fmt) {
            var o = {
                "M+": this.getMonth() + 1, //月份
                "d+": this.getDate(), //日
                "H+": this.getHours(), //小时
                "m+": this.getMinutes(), //分
                "s+": this.getSeconds(), //秒
                "q+": Math.floor((this.getMonth() + 3) / 3), //季度
                "S": this.getMilliseconds() //毫秒
            };
            if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            for (var k in o)
                if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
            return fmt;
        }

        //获取当前时间
        function getDate(){
             //获取当前时间
             var date = new Date();
             //格式化为本地时间格式
             var nowTime = date.Format("yyyy-MM-dd HH:mm:ss");
             //获取div
             var showNowTime = document.getElementById("showNowTime");
             //将时间写入div
            showNowTime.innerHTML = nowTime;
         }
         //使用定时器每秒向div写入当前时间
        setInterval("getDate()",1000);

        function initForm() {
            HttpRequest.post(getApiHttpUrl('api/system/getsysteminfo'), {}, (data)=>{
                if (data.status == "YES") {
                    data = data.data;
                    $("#showUserName").html(data.userName + '(' + data.nickName + ')');
                    $("#userNum").html(data.userNum);
                    $("#projectNum").html(data.projectNum);
                    $("#apiNum").html(data.apiNum);
                    $("#gwUrl").prop('href', data.gwUrl);
                } else {
                    alert(data.info);
                }
            });
        }

        initForm();
    </script>
    </body>
</html>